package com.ham.mud.commands;

import com.ham.mud.ServerConnection;
import com.ham.mud.characters.player.Player;
import com.ham.mud.rooms.Room;
import com.ham.mud.rooms.RoomService;

/**
 * Created by hlucas on Jun 16, 2011 at 5:22:23 PM
 */
public class ExitsCommand extends PlayerCommand {

    @Override
    protected String getCommandName() {
        return "exits";
    }
    
    @Override
    public void execute(ServerConnection connection, String[] params) {
        Player player = connection.getPlayer();
        int atX = player.getAtX();
        int atY = player.getAtY();

        Room room = RoomService.getRoom(player.getZone(), atX, atY);
        connection.println();
        room.displayExits(connection);
        connection.println();
        connection.showPrompt();
    }
}
